'use strict';

/**
 * @ngdoc directive
 * @name webApp.directive:thirdSignIn
 * @description
 * # thirdSignIn
 */

angular.module('webApp')
  .directive('thirdSignIn', function (promiseThirdSignIn) {
  return {
    templateUrl: 'views/thirdSignIn.html',
    restrict: 'AE',
    compile: function(tele,tattr){
      return{
        pre: function($scope,tele,tattr){

        },
        post: function($scope,iele,iattr){
          //第三方登录
          $scope.thirdSignIn = [
            {
              name: '微信登录',
              singInImg: 'share1'
            },
            {
              name: '微博登录',
              singInImg: 'share2',
              href: '/v2/weibo_url'
            },
            {
              name: 'QQ登录',
              singInImg: 'share3',
              href: '/v2/qq_url'
            }
          ];
          //第三方登录链接
          promiseThirdSignIn.thirdSignIn('weixin_url').then(function(data){
            $scope.thirdSignIn[0].href = data;
          });
        }
      }
    }
  };
});
